name = "Alice"
age = 25
score = 95.5

# 1. 字符串格式化
print("My name is %s, I am %d years old, and my score is %f." % (name, age, score))
print("My name is %s, I am %d years old, and my score is %.2f." % (name, age, score))

# 2. 格式化字符串方法
print("My name is {}, I am {} years old, and my score is {:.2f}.".format(name, age, score))
print("My name is {0}, I am {1} years old, and my score is {2:.2f}.".format(name, age, score))
print("My name is {1}, I am {2} years old, and my score is {0:.2f}.".format(score, name, age))
print("My name is {name}, I am {age} years old, and my score is {score:.2f}.".format(name=name, age=age, score=score))
print("My name is {0[0]}, I am {0[1]} years old, and my score is {0[2]:.2f}.".format([name, age, score]))

# 3. f-string
print(f"My name is {name}, I am {age} years old, and my score is {score:.2f}.")
print(f"My name is {name!r}, I am {age!r} years old, and my score is {score!r}.")